﻿<UserControl x:Class="VH.View.CustomerSummaryView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:resources="clr-namespace:VH.Resources;assembly=VH.Resources"
             xmlns:controls="clr-namespace:VH.UI.UserControls.Controls;assembly=VH.UI.UserControls"
             xmlns:converters="clr-namespace:VH.View.Converters"
             mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="10" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <controls:VHLabel
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                FontWeight="SemiBold"
                AddEndingPunctuation="True" Content="{x:Static  resources:LabelResources.FirstName}" />
            <controls:VHLabel
                Grid.Column="1"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.FirstName, Mode=OneWay}" />

            <controls:VHLabel
                Grid.Column="3"
                FontWeight="SemiBold"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="True" Content="{x:Static  resources:LabelResources.LastName}" />
            <controls:VHLabel
                Grid.Column="4"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.LastName, Mode=OneWay}" />

            <controls:VHLabel
                AddEndingPunctuation="True"
                FontWeight="SemiBold"
                Grid.Column="6"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                Content="{x:Static  resources:LabelResources.Gender}" />
            <controls:VHLabel
                Grid.Row="0"
                Grid.Column="7"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.Gender, Mode=OneWay}" />

            <controls:VHLabel
                AddEndingPunctuation="True"
                FontWeight="SemiBold"
                Grid.Row="0"
                Grid.Column="9"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                Content="{x:Static  resources:LabelResources.DOB}" />
            <controls:VHLabel
                Grid.Row="0"
                Grid.Column="10"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.DOB, Mode=OneWay}" />

            <controls:VHLabel
                AddEndingPunctuation="True"
                Grid.Row="2"
                FontWeight="SemiBold"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                Content="{x:Static  resources:LabelResources.EMail}" />
            <controls:VHLabel
                Grid.Row="2"
                Grid.Column="1"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.Email, Mode=OneWay}" />


            <controls:VHLabel
                AddEndingPunctuation="True"
                Grid.Row="1"
                FontWeight="SemiBold"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                Content="{x:Static  resources:LabelResources.Address}" />

            <controls:VHLabel
                Grid.Row="1"
                Grid.Column="1"
                Grid.ColumnSpan="10"
                FontFamily="{StaticResource MixedContentFontFamily}"
                FontSize="{StaticResource ControlTitleFontSize}"
                AddEndingPunctuation="False" Content="{Binding Entity.FormattedAddressPhone, Mode=OneWay}" />
        </Grid>

        <!--Visibility="{Binding Entity.HasCustomerHearingAidOrder, Converter={StaticResource BooleanToVisibilityConverter}}"-->
        <GroupBox
            Grid.Row="1" Margin="0,8,4,0"
            Header="{x:Static resources:LabelResources.OrderHeardingAid}"
            FontFamily="{StaticResource MixedHeaderFontFamily}"
            FontSize="{StaticResource ContentFontSize}" Style="{StaticResource MetroGroupBox}">
            <Grid>
                <ListView
                     x:Name="CustomerHearingAidOrderCollection"
                    ItemsSource="{Binding Entity.CustomerHearingAidOrderCollection}"
                    BorderThickness="0"
                    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                    ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <ListView.Resources>
                        <Style TargetType="{x:Type ListViewItem}"
                               BasedOn="{StaticResource DefaultListViewItemStyle}">
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                            <Setter Property="ToolTip" Value="{Binding StatusToolTip}" />
                        </Style>
                    </ListView.Resources>
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderID}"
                                                        DisplayMemberBinding="{Binding ID}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderDate}"
                                                        DisplayMemberBinding="{Binding OrderDate, StringFormat={}{0: MMMM, dd, yyyy}}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.EarSide}"
                                                        DisplayMemberBinding="{Binding EarSide}" Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.Company}"
                                                        DisplayMemberBinding="{Binding Company}" Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.AidType}"
                                                        DisplayMemberBinding="{Binding HearingAidType}" Width="Auto" />
                            <!--<GridViewColumn Header="{x:Static resources:LabelResources.Model}"
                                                        DisplayMemberBinding="{Binding HIModel}" Width="Auto" />
                                        <GridViewColumn Header="{x:Static resources:LabelResources.SerialNumber}"
                                                        DisplayMemberBinding="{Binding SerialNumber}" Width="Auto" />-->
                            <GridViewColumn Header="{x:Static resources:LabelResources.Amount}"
                                                        DisplayMemberBinding="{Binding Amount, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.AdvanceAmount}"
                                                        DisplayMemberBinding="{Binding AdvanceAmtReceived, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.BalanceAmount}"
                                                        DisplayMemberBinding="{Binding BalanceAmount, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderStatus}"
                                                        DisplayMemberBinding="{Binding OrderStatus}" Width="Auto" />
                        </GridView>
                    </ListView.View>
                </ListView>
            </Grid>
        </GroupBox>

        <!--Visibility="{Binding Entity.HasCustomerEarMoldOrder, Converter={StaticResource BooleanToVisibilityConverter}}"-->
        <GroupBox
            Margin="0,8,4,0"
            Grid.Row="2"
            Header="{x:Static resources:LabelResources.OrderEarMold}"
            FontFamily="{StaticResource MixedHeaderFontFamily}"
            FontSize="{StaticResource ContentFontSize}" Style="{StaticResource MetroGroupBox}">
            <Grid>
                <ListView
                     x:Name="CustomerEarMoldOrderCollection"
                    ItemsSource="{Binding Entity.CustomerEarMoldOrderCollection}"
                    BorderThickness="0"
                    ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                    ScrollViewer.VerticalScrollBarVisibility="Auto">
                    <ListView.Resources>
                        <Style TargetType="{x:Type ListViewItem}"
                               BasedOn="{StaticResource DefaultListViewItemStyle}">
                            <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                            <Setter Property="ToolTip" Value="{Binding StatusToolTip}" />
                        </Style>
                    </ListView.Resources>
                    <ListView.View>
                        <GridView>
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderID}"
                                                        DisplayMemberBinding="{Binding ID}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderDate}"
                                                        DisplayMemberBinding="{Binding OrderDate, StringFormat={}{0: MMMM, dd, yyyy }}"
                                                        Width="Auto" />
                            <!--<GridViewColumn Header="{x:Static resources:LabelResources.HearingAidId}"
                                                        DisplayMemberBinding="{Binding HearingAidOrderId}" Width="Auto" />-->
                            <!--<GridViewColumn Header="{x:Static resources:LabelResources.Model}"
                                                        DisplayMemberBinding="{Binding HIModel}" Width="Auto" />-->
                            <GridViewColumn Header="{x:Static resources:LabelResources.EarSide}"
                                                        DisplayMemberBinding="{Binding EarSide}" Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.AidType}"
                                                        DisplayMemberBinding="{Binding EarMoldHearingAidType}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.EarMoldDesign}"
                                                        DisplayMemberBinding="{Binding EarMoldDesign}" Width="Auto" />

                            <GridViewColumn Header="{x:Static resources:LabelResources.Amount}"
                                                        DisplayMemberBinding="{Binding MoldAmount, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.AdvanceAmount}"
                                                        DisplayMemberBinding="{Binding AdvanceAmtReceived, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.BalanceAmount}"
                                                        DisplayMemberBinding="{Binding BalanceAmount, StringFormat=C, ConverterCulture=en-IN}"
                                                        Width="Auto" />
                            <GridViewColumn Header="{x:Static resources:LabelResources.OrderStatus}"
                                                        DisplayMemberBinding="{Binding OrderStatus}" Width="Auto" />
                        </GridView>
                    </ListView.View>
                </ListView>
            </Grid>
        </GroupBox>

        <!--Visibility="{Binding Entity.HasCustomerRepair, Converter={StaticResource BooleanToVisibilityConverter}}"-->
        <GroupBox
            Grid.Row="3"
            x:Name="RepairList"
            Margin="0,8,4,0"
            Visibility="Collapsed"
            Header="{x:Static resources:LabelResources.RepairList}"
            FontFamily="{StaticResource MixedHeaderFontFamily}"
            FontSize="{StaticResource ContentFontSize}" Style="{StaticResource MetroGroupBox}">
            <ListView
                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                ItemsSource="{Binding Entity.CustomerRepairCollection}"
                BorderThickness="0">
                <ListView.Resources>
                    <Style TargetType="{x:Type ListViewItem}" BasedOn="{StaticResource DefaultListViewItemStyle}">
                        <Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}" />
                        <Setter Property="ToolTip" Value="{Binding StatusToolTip}" />
                    </Style>
                </ListView.Resources>
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="{x:Static resources:LabelResources.RepairID}"
                                        DisplayMemberBinding="{Binding ID}" Width="Auto" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.ReceivedDate}"
                                        DisplayMemberBinding="{Binding ReceivedDate}" Width="Auto" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.Company}"
                                        DisplayMemberBinding="{Binding Company}" Width="Auto" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.Model}"
                                        DisplayMemberBinding="{Binding Model}" Width="Auto" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.ComplaintDesc}"
                                        DisplayMemberBinding="{Binding ComplaintDescription}" Width="Auto" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.RepairStatus}"
                                        DisplayMemberBinding="{Binding RepairStatus, Converter={converters:EnumToResourceConverter}}" />
                        <GridViewColumn Header="{x:Static resources:LabelResources.Comment}"
                                        DisplayMemberBinding="{Binding AdditionalComment}" Width="Auto" />
                    </GridView>
                </ListView.View>
            </ListView>
        </GroupBox>

    </Grid>
</UserControl>
